package com.beeantec.jnrerc.modules.course.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.beeantec.jnrerc.entity.CourseChapter;
import com.beeantec.jnrerc.entity.CourseIntroduce;
import com.beeantec.jnrerc.entity.Member;
import com.beeantec.jnrerc.mapper.CourseIntroduceMapper;
import com.beeantec.jnrerc.modules.course.service.CourseChapterService;
import com.beeantec.jnrerc.modules.course.service.CourseIntroduceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Wrapper;
import java.util.List;

@Service
public class CourseIntroduceServiceImpl extends ServiceImpl<CourseIntroduceMapper, CourseIntroduce> implements CourseIntroduceService {

    @Autowired
    CourseChapterService courseChapterService;
    /**
     * 根据章节编号、状态ID查找章节信息
     */
    @Override
    public List<CourseChapter> listByCourseIdAndStatusId(Long courseId, Integer statusId) {
        QueryWrapper<CourseChapter> wrapper = new QueryWrapper<>();
        wrapper.lambda().eq(CourseChapter::getCourseId, courseId).eq(CourseChapter::getStatusId,statusId);
        return courseChapterService.list(wrapper);
    }
}
